import { http } from "@/utils/http";

export class Menu {
  id: number;
  name: string;
  type: string;
  route: string;
  icon: string;
  sort: number;
  breadcrumbParentId: number;
  menuParentId: number;
}

export const getAsyncRoutes = () => {
  return http.request<Menu[]>("get", "/admin/admin/admin/menus", null, Menu);
};

type Result = {
  success: boolean;
  data: Array<any>;
};

export const getAsyncRoutes2 = () => {
  return http.request<Result>("get", "/get-async-routes");
};
